﻿@model MvcAgenda.Domain.Entities.user

@{
    ViewBag.Title = "Profile";
}

<h2>Profile</h2>

@using (Html.BeginForm("Edit","Users")) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>user</legend>

        @Html.HiddenFor(model => model.id)

        <div class="editor-label">
            @Html.LabelFor(model => model.username)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.username)
            @Html.ValidationMessageFor(model => model.username)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.password)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.password)
            @Html.ValidationMessageFor(model => model.password)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.email)
            @Html.ValidationMessageFor(model => model.email)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
       @* @Html.EditorForModel()*@
    </fieldset>
}
        @if (User.Identity.Name == "admin")
        {
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
